Skip to content

Conversation

@eeldaly
Copy link
Contributor

@eeldaly eeldaly commented Jan 14, 2026

What this PR does:
Add an active api tracker to print api requests in a querier on OOMKill / crash

Example log:

"These API calls didn't finish in prometheus' last run:"apis="[
{\"Method\":\"GET\",
\"Path\":\"/prometheus/api/v1/series\",
\"User-Agent\":\"PostmanRuntime/7.49.1\",
\"X-Request-ID\":\"\",
\"X-Scope-OrgID\":\"12345\",
\"end\":\"\",
\"limit\":\"100\",
\"matches\"\"metric_0metric_0metric_0m,metric_1metric_1metric_1m,metric_2metric_2metric_2m,metric_3metric_3metric\",
\"number-of-matches\":5,
\"start\":\"\",
\"timestamp_sec\":1768349758
}]"

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Copy link
Contributor

@justinjung04 justinjung04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

eeldaly and others added 2 commits January 23, 2026 14:23
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com>
@eeldaly
Copy link
Contributor Author

eeldaly commented Jan 28, 2026

One issue that still needs to be addressed is that the request id is not yet in the context at the time of it being added to the tracker. Getting request id from context currently returns an empty string

Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
@eeldaly eeldaly requested a review from yeya24 January 30, 2026 21:44
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
…caped characters

Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
@eeldaly eeldaly requested a review from yeya24 February 4, 2026 21:20
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint failure is also relevant

Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
eeldaly and others added 2 commits February 10, 2026 13:12
Signed-off-by: Essam Eldaly <60357054+eeldaly@users.noreply.github.com>
Signed-off-by: Essam Eldaly <eeldaly@amazon.com>
@yeya24 yeya24 merged commit ad70245 into cortexproject:master Feb 10, 2026
56 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants